<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Insert title here</title>

		<!-- 生产环境版本，优化了尺寸和速度 -->
		<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.min.js"></script>
		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

	</head>
	<body>


		<div id="app">
			<div>
				<button @click="loadUser">加载数据</button>
			</div>


			<div v-for="user in  userList" :key="user.userNo">
				{{user.userName}}
			</div>

		</div>


		<script>
			axios.set

			var app = new Vue({
				el: '#app',
				data: {
					message: 'Hello Vue!',
					userList: []
				},
				methods: {

					async loadUser() {
						const res = await axios.get('http://localhost/user/list', {
							headers: {
								'token': 'JXC-BOOT'
							},params:{
								page:2,
								rows:10
							}
						});
						console.log(res.data)
						this.userList = res.data.rows;
						console.log(this.userList)
					}
				}
			})
		</script>

	</body>
</html>
